
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.10 布局 · gitbook电子书</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../JS/" />
    
    
    <link rel="prev" href="9.滤镜.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../使用/使用.html">
            
                <a href="../使用/使用.html">
            
                    
                    md语法 & gitbook使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../面试题/面试题.html">
            
                <a href="../面试题/面试题.html">
            
                    
                    面试题
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../面试题/html.html">
            
                <a href="../面试题/html.html">
            
                    
                    HTML
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../面试题/css.html">
            
                <a href="../面试题/css.html">
            
                    
                    CSS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../面试题/js.html">
            
                <a href="../面试题/js.html">
            
                    
                    JavaScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../面试题/vue.html">
            
                <a href="../面试题/vue.html">
            
                    
                    Vue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="../面试题/小程序.html">
            
                <a href="../面试题/小程序.html">
            
                    
                    小程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="../面试题/编程题.html">
            
                <a href="../面试题/编程题.html">
            
                    
                    编程题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../html/">
            
                <a href="../html/">
            
                    
                    1. HTML
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../html/1.常用标签.html">
            
                <a href="../html/1.常用标签.html">
            
                    
                    1.1 常用标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../html/2.列表.html">
            
                <a href="../html/2.列表.html">
            
                    
                    1.2 列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../html/3.表单.html">
            
                <a href="../html/3.表单.html">
            
                    
                    1.3 表单属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../html/4.音频&视频.html">
            
                <a href="../html/4.音频&视频.html">
            
                    
                    1.4 ifame & audio & video
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                    2. CSS
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="1.选择器.html">
            
                <a href="1.选择器.html">
            
                    
                    2.1 选择器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="2.字体样式.html">
            
                <a href="2.字体样式.html">
            
                    
                    2.2 字体样式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="3.背景.html">
            
                <a href="3.背景.html">
            
                    
                    2.3 背景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="4.盒子模型.html">
            
                <a href="4.盒子模型.html">
            
                    
                    2.4 盒子模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="5.浮动.html">
            
                <a href="5.浮动.html">
            
                    
                    2.5 浮动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="6.定位和渐变.html">
            
                <a href="6.定位和渐变.html">
            
                    
                    2.6 定位 & 渐变
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="7.过渡&变形.html">
            
                <a href="7.过渡&变形.html">
            
                    
                    2.7 过渡 & 变形
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.8" data-path="8.动画.html">
            
                <a href="8.动画.html">
            
                    
                    2.8 动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.9" data-path="9.滤镜.html">
            
                <a href="9.滤镜.html">
            
                    
                    2.9 滤镜
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.10" data-path="10.布局.html">
            
                <a href="10.布局.html">
            
                    
                    2.10 布局
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../JS/">
            
                <a href="../JS/">
            
                    
                    3. JS
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../JS/数据类型.html">
            
                <a href="../JS/数据类型.html">
            
                    
                    3.1 数据类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../JS/语句.html">
            
                <a href="../JS/语句.html">
            
                    
                    操作符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../JS/操作符.html">
            
                <a href="../JS/操作符.html">
            
                    
                    语句
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../JS/函数.html">
            
                <a href="../JS/函数.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../JS/基本类型和引用类型的值.html">
            
                <a href="../JS/基本类型和引用类型的值.html">
            
                    
                    基本类型和引用类型的值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../JS/执行环境及作用域.html">
            
                <a href="../JS/执行环境及作用域.html">
            
                    
                    执行环境及作用域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../JS/垃圾收集.html">
            
                <a href="../JS/垃圾收集.html">
            
                    
                    垃圾收集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../JS/Object类型.html">
            
                <a href="../JS/Object类型.html">
            
                    
                    Object类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="../JS/Array类型.html">
            
                <a href="../JS/Array类型.html">
            
                    
                    Array类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="../JS/Date类型.html">
            
                <a href="../JS/Date类型.html">
            
                    
                    Date类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="../JS/string&array.html">
            
                <a href="../JS/string&array.html">
            
                    
                    3.2 String & Array
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="../JS/date.html">
            
                <a href="../JS/date.html">
            
                    
                    3.3 Date类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="../JS/正则表达式.html">
            
                <a href="../JS/正则表达式.html">
            
                    
                    3.4 RegExp类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="../JS/global&math.html">
            
                <a href="../JS/global&math.html">
            
                    
                    3.5 Global对象 & Math对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.15" data-path="../JS/变量&作用域&垃圾收集.html">
            
                <a href="../JS/变量&作用域&垃圾收集.html">
            
                    
                    3.6 变量 & 作用域 & 垃圾收集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.16" data-path="../JS/流程控制&函数.html">
            
                <a href="../JS/流程控制&函数.html">
            
                    
                    3.7 流程控制 & 函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.17" data-path="../JS/面向对象.html">
            
                <a href="../JS/面向对象.html">
            
                    
                    3.8 面向对象的程序设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.18" data-path="../JS/递归&冒泡&快速.html">
            
                <a href="../JS/递归&冒泡&快速.html">
            
                    
                    3.9 递归 & 冒泡 & 快速
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.19" data-path="../JS/定时器&防抖&节流.html">
            
                <a href="../JS/定时器&防抖&节流.html">
            
                    
                    3.10 定时器\防抖\节流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.20" data-path="../JS/DOM获取&DOM操作.html">
            
                <a href="../JS/DOM获取&DOM操作.html">
            
                    
                    3.11 DOM获取 & DOM操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.21" data-path="../JS/键盘事件&鼠标事件.html">
            
                <a href="../JS/键盘事件&鼠标事件.html">
            
                    
                    3.12 键盘事件 & 鼠标事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.22" data-path="../JS/事件冒泡&事件代理&事件绑定.html">
            
                <a href="../JS/事件冒泡&事件代理&事件绑定.html">
            
                    
                    3.13 事件冒泡\代理\绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.23" data-path="../JS/this指向.html">
            
                <a href="../JS/this指向.html">
            
                    
                    3.14 this指向
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.24" data-path="../JS/Ajax&跨域.html">
            
                <a href="../JS/Ajax&跨域.html">
            
                    
                    3.15 Ajax & 跨域
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.25" data-path="../JS/Bom.html">
            
                <a href="../JS/Bom.html">
            
                    
                    3.16 BOM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.26" data-path="../JS/ES6.html">
            
                <a href="../JS/ES6.html">
            
                    
                    3.17 ES6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.27" data-path="../JS/js实例.html">
            
                <a href="../JS/js实例.html">
            
                    
                    3.18 js实例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../vue/">
            
                <a href="../vue/">
            
                    
                    4. Vue
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../vue/1.基础.html">
            
                <a href="../vue/1.基础.html">
            
                    
                    4.1 基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../vue/2.生命周期.html">
            
                <a href="../vue/2.生命周期.html">
            
                    
                    4.2 生命周期
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../vue/3.vuex.html">
            
                <a href="../vue/3.vuex.html">
            
                    
                    4.3 vuex
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../vue/4.原理.html">
            
                <a href="../vue/4.原理.html">
            
                    
                    4.4 深入响应式原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../vue/5.组件.html">
            
                <a href="../vue/5.组件.html">
            
                    
                    4.5 组件进阶
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../vue/6.规模化.html">
            
                <a href="../vue/6.规模化.html">
            
                    
                    4.6 规模化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../vue/7.过渡&动画.html">
            
                <a href="../vue/7.过渡&动画.html">
            
                    
                    4.7 过渡 & 动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../vue/8.可复用性&组合.html">
            
                <a href="../vue/8.可复用性&组合.html">
            
                    
                    4.8 可复用性 & 组合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../vue/9.工具.html">
            
                <a href="../vue/9.工具.html">
            
                    
                    4.9 工具
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../Node/">
            
                <a href="../Node/">
            
                    
                    5. Node
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../插件/">
            
                <a href="../插件/">
            
                    
                    插件
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.10 布局</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5E03;&#x5C40;">&#x5E03;&#x5C40;</h1>
<h2 id="rem&#x5E03;&#x5C40;&#x624B;&#x673A;&#x7AEF;&#x9002;&#x914D;">rem&#x5E03;&#x5C40;(&#x624B;&#x673A;&#x7AEF;&#x9002;&#x914D;)</h2>
<p><a href="http://caibaojian.com/web-app-rem.html" target="_blank">rem&#x5E03;&#x5C40;&#x8BF4;&#x660E;</a><br><a href="http://caibaojian.com/simple-flexible.html" target="_blank">rem&#x5E03;&#x5C40;&#x4F7F;&#x7528;&#x8BF4;&#x660E;&#x4EE3;&#x7801;&#x90E8;&#x5206;</a></p>
<blockquote>
<p>em:&#x662F;&#x76F8;&#x5BF9;&#x7236;&#x4EB2;&#x5B57;&#x4F53;&#x5927;&#x5C0F;&#x7684;&#x5355;&#x4F4D;<br>rem(Root em)&#xFF1A;&#x76F8;&#x5BF9;&#x6839;&#x8282;&#x70B9;&#x5B57;&#x4F53;&#x5927;&#x5C0F;&#x7684;&#x5355;&#x4F4D;<br>&#x603B;&#x7ED3;&#xFF0C;&#x5C4F;&#x5E55;&#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x63A5;&#x6536;px&#xFF0C;rem&#x548C;em&#x90FD;&#x662F;&#x4E00;&#x4E2A;&#x76F8;&#x5BF9;&#x5355;&#x4F4D;&#xFF0C;&#x5C5E;&#x4E8E;&#x6309;&#x7167;&#x4E00;&#x5B9A;&#x6BD4;&#x4F8B;&#x7F29;&#x653E;    </p>
</blockquote>
<pre><code class="lang-css">&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no&quot; /&gt;
@function r($px){
   return ($px/40)*1rem;
}
</code></pre>
<pre><code class="lang-js">&lt;script type=<span class="hljs-string">&quot;text/javascript&quot;</span>&gt;
    <span class="hljs-built_in">document</span>.body.style.height = <span class="hljs-built_in">window</span>.innerHeight + <span class="hljs-string">&quot;px&quot;</span>;
    <span class="hljs-comment">/*&#x52A8;&#x6001;&#x6539;&#x53D8;&#x6839;&#x5143;&#x7D20;&#x5B57;&#x4F53;&#x5927;&#x5C0F;*/</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">recalc</span>(<span class="hljs-params"></span>) </span>{
        <span class="hljs-comment">//&#x83B7;&#x53D6;&#x5BA2;&#x6237;&#x7AEF;&#x5BBD;&#x5EA6;</span>
        <span class="hljs-keyword">var</span> clientWidth = <span class="hljs-built_in">document</span>.documentElement.clientWidth;
        <span class="hljs-keyword">if</span>(!clientWidth) <span class="hljs-keyword">return</span>;
        <span class="hljs-comment">// &#x5B57;&#x4F53;&#x5927;&#x5C0F;   = 1&#x4E2A;rem&#x5355;&#x4F4D;&#x8868;&#x793A;&#x591A;&#x5C11;&#x4E2A;&#x50CF;&#x7D20;&#xFF08;&#x8BBE;&#x5907;&#x7684;&#x5BBD;&#x5EA6;   /&#x8BBE;&#x8BA1;&#x5BBD;&#x5EA6;&#xFF09;</span>
        <span class="hljs-built_in">document</span>.documentElement.style.fontSize = <span class="hljs-number">40</span> * (clientWidth / <span class="hljs-number">750</span>) + <span class="hljs-string">&apos;px&apos;</span>;
    }
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">initRecalc</span>(<span class="hljs-params"></span>) </span>{
        recalc();
        <span class="hljs-comment">// if(&#x6D4F;&#x89C8;&#x5668;&#x652F;&#x6301;&#x6A2A;&#x7AD6;&#x5C4F;&#x5207;&#x6362;&#x7684;&#x4E8B;&#x4EF6;){&#x6A2A;&#x7AD6;&#x5C4F;&#x4E8B;&#x4EF6;}else{ resize&#x4E8B;&#x4EF6; }</span>
        <span class="hljs-keyword">var</span> resizeEvt = <span class="hljs-string">&apos;osrientationchange&apos;</span> <span class="hljs-keyword">in</span> <span class="hljs-built_in">window</span> ? <span class="hljs-string">&apos;orientationchange&apos;</span> : <span class="hljs-string">&apos;resize&apos;</span>;
        <span class="hljs-keyword">if</span>(!<span class="hljs-built_in">document</span>.addEventListener) <span class="hljs-keyword">return</span>;
        <span class="hljs-built_in">window</span>.addEventListener(resizeEvt, recalc, <span class="hljs-literal">false</span>);
        <span class="hljs-built_in">document</span>.addEventListener(<span class="hljs-string">&apos;DOMContentLoaded&apos;</span>, recalc, <span class="hljs-literal">false</span>);
    }
    initRecalc();
<span class="xml"><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></span>
</code></pre>
<h2 id="vw--vh">vw &amp; vh</h2>
<pre><code class="lang-css"><span class="hljs-selector-class">.box</span>{
    <span class="hljs-comment">/* &#x5C4F;&#x5E55;&#x5BBD;100% */</span>
    <span class="hljs-attribute">width</span>: <span class="hljs-number">100vw</span>;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">100px</span>;
    <span class="hljs-attribute">background</span>: skyblue;
}
</code></pre>
<h2 id="&#x5F39;&#x6027;&#x76D2;&#x5B50;">&#x5F39;&#x6027;&#x76D2;&#x5B50;</h2>
<h4 id="&#x7236;&#x5BB9;&#x5668;">&#x7236;&#x5BB9;&#x5668;</h4>
<table>
<thead>
<tr>
<th style="text-align:left">&#x5C5E;&#x6027;</th>
<th style="text-align:left">&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">display</td>
<td style="text-align:left">&#x6307;&#x5B9A;&#x7236;&#x5BB9;&#x5668;&#x7C7B;&#x578B;</td>
</tr>
<tr>
<td style="text-align:left">flex-direction</td>
<td style="text-align:left">&#x6307;&#x5B9A;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x6392;&#x5217;&#x65B9;&#x5411;</td>
</tr>
<tr>
<td style="text-align:left">justify-content</td>
<td style="text-align:left">&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x5728;&#x6A2A;&#x8F74;&#x4E0A;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:left">align-items</td>
<td style="text-align:left">&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x5728;&#x7EB5;&#x8F74;&#x4E0A;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:left">flex-wrap</td>
<td style="text-align:left">&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x662F;&#x5426;&#x6362;&#x884C;</td>
</tr>
<tr>
<td style="text-align:left">align-content</td>
<td style="text-align:left">&#x4FEE;&#x6539;flex-wrap&#x5C5E;&#x6027;&#x7684;&#x884C;&#x4E3A;&#xFF0C;&#x8BBE;&#x7F6E;&#x884C;&#x5BF9;&#x9F50;</td>
</tr>
<tr>
<td style="text-align:left">flex-flow</td>
<td style="text-align:left">flex-direction&#x548C;flex-wrap&#x7684;&#x7B80;&#x5199;</td>
</tr>
</tbody>
</table>
<h4 id="&#x5B50;&#x5143;&#x7D20;">&#x5B50;&#x5143;&#x7D20;</h4>
<table>
<thead>
<tr>
<th style="text-align:left">&#x5C5E;&#x6027;</th>
<th style="text-align:left">&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">order</td>
<td style="text-align:left">&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x7684;&#x6392;&#x5217;&#x5FAA;&#x5E8F;</td>
</tr>
<tr>
<td style="text-align:left">align-self</td>
<td style="text-align:left">&#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5B50;&#x9879;&#x7684;&#x5BF9;&#x9F50;&#x65B9;&#x5F0F;</td>
</tr>
<tr>
<td style="text-align:left">flex</td>
<td style="text-align:left">&#x8BBE;&#x7F6E;&#x5B50;&#x5143;&#x7D20;&#x5206;&#x914D;&#x7A7A;&#x95F4;</td>
</tr>
</tbody>
</table>
<pre><code>1.&#x7236;&#x5143;&#x7D20;&#x8BBE;&#x7F6E;&#x5F39;&#x6027;&#x76D2;&#x5B50;&#xFF0C;&#x4F5C;&#x7528;&#x5728;**&#x76F4;&#x5C5E;&#x5B50;&#x5143;&#x7D20;**&#x4E0A;
2.&#x5B50;&#x5143;&#x7D20;&#x4E2D;float/clearfix/vertical-align &#x4E0D;&#x8D77;&#x4F5C;&#x7528;
3.flex&#x5C5E;&#x6027;&#x9ED8;&#x8BA4;&#x4E3A;none&#xFF08;flex-shrink&#xFF1A;1&#xFF1B;flex-grow&#xFF1A;0&#xFF1B;&#xFF09;
  flex&#x4E3A;0&#x65F6;&#xFF0C;&#x5BBD;&#x5EA6;&#x7531;&#x5185;&#x5BB9;&#x6491;&#x5F00;&#xFF08;&#x548C;inline&#x7C7B;&#x4F3C;&#xFF09;
  flex&#x4E3A;&#x975E;0&#x65F6;&#xFF0C;&#x6309;&#x7167;&#x6BD4;&#x4F8B;&#x5206;&#x914D;&#x7236;&#x5143;&#x7D20;&#x5BBD;&#x5EA6;
4.flex-grow&#xFF0C;&#x7236;&#x5143;&#x7D20;&#x5BBD;&#x5EA6;&#x7684;&#x5269;&#x4F59;&#x90E8;&#x5206;&#x6309;&#x6BD4;&#x4F8B;&#x5212;&#x5206;&#x589E;&#x52A0;&#x7ED9;&#x5B50;&#x9879;
5.flex-shrink&#xFF0C;&#xFF08;&#x5B50;&#x9879;&#x603B;&#x5BBD;&#x5EA6;-&#x7236;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x5EA6;&#xFF09;*&#xFF08;&#x81EA;&#x8EAB;shrink/&#x603B;shrink&#xFF09;&#xFF0C;&#x8868;&#x793A;&#x5B50;&#x9879;&#x51CF;&#x5C11;&#x5BBD;&#x5EA6;&#x7684;&#x6BD4;&#x4F8B;
6.flex-flow&#xFF1A;flex-direction&#xFF08;&#x6392;&#x5217;&#x65B9;&#x5411;&#xFF09;+flex-wrap&#xFF08;&#x6362;&#x884C;&#xFF09;
7.justify-content&#x6C34;&#x5E73;&#x5BF9;&#x9F50;&#xFF0C;center&#xFF08;&#x5C45;&#x4E2D;&#xFF09;&#x3001;space-between&#xFF08;&#x5206;&#x914D;&#x5269;&#x4F59;&#x7A7A;&#x95F4;&#xFF0C;&#x4E24;&#x7AEF;&#x4E0D;&#x7559;&#x767D;&#xFF09;&#x3001;space-around&#xFF08;&#x5206;&#x914D;&#x5269;&#x4F59;&#x7A7A;&#x95F4;&#xFF0C;&#x4E24;&#x7AEF;&#x7559;&#x767D;&#xFF09;
8.align-content&#x591A;&#x6761;&#x4EA4;&#x53C9;&#x8F74;&#x5BF9;&#x9F50;&#xFF0C;&#x9ED8;&#x8BA4;&#x503C;stretch&#xFF08;&#x5B50;&#x9879;&#x4E0D;&#x8BBE;&#x7F6E;&#x9AD8;&#x5EA6;&#x65F6;&#xFF0C;&#x5B50;&#x9879;&#x7684;&#x9AD8;&#x5EA6;&#x81EA;&#x52A8;&#x62C9;&#x4F38;&#xFF09;
9.align-items&#x4E00;&#x884C;&#x5185;&#x7684;&#x5782;&#x76F4;&#x5BF9;&#x9F50;&#xFF0C;baseline&#x57FA;&#x7EBF;&#x5BF9;&#x9F50;
10.align-self&#x5355;&#x72EC;&#x8BBE;&#x7F6E;&#x5B50;&#x9879;&#x7684;&#x5782;&#x76F4;&#x5BF9;&#x9F50;&#x65B9;&#x5411;
11.order&#x6743;&#x503C;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;0&#xFF0C;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x8D1F;&#x503C;&#xFF0C;&#x6743;&#x503C;&#x8D8A;&#x5927;&#xFF0C;&#x6392;&#x5217;&#x5728;&#x8D8A;&#x540E;
</code></pre><h2 id="&#x5A92;&#x4F53;&#x67E5;&#x8BE2;">&#x5A92;&#x4F53;&#x67E5;&#x8BE2;</h2>
<p>head&#x90E8;&#x5206;&#xFF1A;</p>
<pre><code>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no&quot; /&gt;
&lt;!-- &#x5A92;&#x4F53;&#x67E5;&#x8BE2;&#x5F15;&#x5165; --&gt;
&lt;link media=&quot;screen and (max-device-width:414px)&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style414.css&quot;/&gt;
&lt;link media=&quot;screen and (max-device-width:375px)&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style375.css&quot;/&gt;
</code></pre><pre><code class="lang-css">@<span class="hljs-keyword">media</span> screen and (max-width: <span class="hljs-number">700px</span>) and (min-width:<span class="hljs-number">480px</span> ){
    <span class="hljs-selector-tag">li</span>{
        <span class="hljs-attribute">width</span>: <span class="hljs-number">33.33%</span>;
    }
}
@<span class="hljs-keyword">media</span> screen and (max-width: <span class="hljs-number">479px</span>){
    <span class="hljs-selector-tag">li</span>{
        <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
    }
}
</code></pre>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">picture</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">&quot;img/w1.jpg&quot;</span> <span class="hljs-attr">media</span>=<span class="hljs-string">&quot;(min-device-width:1000px)&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">source</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">source</span> <span class="hljs-attr">srcset</span>=<span class="hljs-string">&quot;img/w2.jpg&quot;</span> <span class="hljs-attr">media</span>=<span class="hljs-string">&quot;(min-device-width:500px)&quot;</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">source</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">&quot;img/flood1.jpg&quot;</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">&quot;&quot;</span>/&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">picture</span>&gt;</span>
</code></pre>
<h2 id="bootstrap&#x54CD;&#x5E94;&#x5F0F;&#x5E03;&#x5C40;">bootstrap(&#x54CD;&#x5E94;&#x5F0F;&#x5E03;&#x5C40;)</h2>
<p><a href="https://v3.bootcss.com/getting-started/" target="_blank">bootstrap&#x7684;&#x4F7F;&#x7528;</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="9.滤镜.html" class="navigation navigation-prev " aria-label="Previous page: 2.9 滤镜">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../JS/" class="navigation navigation-next " aria-label="Next page: 3. JS">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.10 布局","level":"1.4.10","depth":2,"next":{"title":"3. JS","level":"1.5","depth":1,"path":"JS/README.md","ref":"JS/README.md","articles":[{"title":"3.1 数据类型","level":"1.5.1","depth":2,"path":"JS/数据类型.md","ref":"JS/数据类型.md","articles":[]},{"title":"操作符","level":"1.5.2","depth":2,"path":"JS/语句.md","ref":"JS/语句.md","articles":[]},{"title":"语句","level":"1.5.3","depth":2,"path":"JS/操作符.md","ref":"JS/操作符.md","articles":[]},{"title":"函数","level":"1.5.4","depth":2,"path":"JS/函数.md","ref":"JS/函数.md","articles":[]},{"title":"基本类型和引用类型的值","level":"1.5.5","depth":2,"path":"JS/基本类型和引用类型的值.md","ref":"JS/基本类型和引用类型的值.md","articles":[]},{"title":"执行环境及作用域","level":"1.5.6","depth":2,"path":"JS/执行环境及作用域.md","ref":"JS/执行环境及作用域.md","articles":[]},{"title":"垃圾收集","level":"1.5.7","depth":2,"path":"JS/垃圾收集.md","ref":"JS/垃圾收集.md","articles":[]},{"title":"Object类型","level":"1.5.8","depth":2,"path":"JS/Object类型.md","ref":"JS/Object类型.md","articles":[]},{"title":"Array类型","level":"1.5.9","depth":2,"path":"JS/Array类型.md","ref":"JS/Array类型.md","articles":[]},{"title":"Date类型","level":"1.5.10","depth":2,"path":"JS/Date类型.md","ref":"JS/Date类型.md","articles":[]},{"title":"3.2 String & Array","level":"1.5.11","depth":2,"path":"JS/string&array.md","ref":"JS/string&array.md","articles":[]},{"title":"3.3 Date类型","level":"1.5.12","depth":2,"path":"JS/date.md","ref":"JS/date.md","articles":[]},{"title":"3.4 RegExp类型","level":"1.5.13","depth":2,"path":"JS/正则表达式.md","ref":"JS/正则表达式.md","articles":[]},{"title":"3.5 Global对象 & Math对象","level":"1.5.14","depth":2,"path":"JS/global&math.md","ref":"JS/global&math.md","articles":[]},{"title":"3.6 变量 & 作用域 & 垃圾收集","level":"1.5.15","depth":2,"path":"JS/变量&作用域&垃圾收集.md","ref":"JS/变量&作用域&垃圾收集.md","articles":[]},{"title":"3.7 流程控制 & 函数","level":"1.5.16","depth":2,"path":"JS/流程控制&函数.md","ref":"JS/流程控制&函数.md","articles":[]},{"title":"3.8 面向对象的程序设计","level":"1.5.17","depth":2,"path":"JS/面向对象.md","ref":"JS/面向对象.md","articles":[]},{"title":"3.9 递归 & 冒泡 & 快速","level":"1.5.18","depth":2,"path":"JS/递归&冒泡&快速.md","ref":"JS/递归&冒泡&快速.md","articles":[]},{"title":"3.10 定时器\\防抖\\节流","level":"1.5.19","depth":2,"path":"JS/定时器&防抖&节流.md","ref":"JS/定时器&防抖&节流.md","articles":[]},{"title":"3.11 DOM获取 & DOM操作","level":"1.5.20","depth":2,"path":"JS/DOM获取&DOM操作.md","ref":"JS/DOM获取&DOM操作.md","articles":[]},{"title":"3.12 键盘事件 & 鼠标事件","level":"1.5.21","depth":2,"path":"JS/键盘事件&鼠标事件.md","ref":"JS/键盘事件&鼠标事件.md","articles":[]},{"title":"3.13 事件冒泡\\代理\\绑定","level":"1.5.22","depth":2,"path":"JS/事件冒泡&事件代理&事件绑定.md","ref":"JS/事件冒泡&事件代理&事件绑定.md","articles":[]},{"title":"3.14 this指向","level":"1.5.23","depth":2,"path":"JS/this指向.md","ref":"JS/this指向.md","articles":[]},{"title":"3.15 Ajax & 跨域","level":"1.5.24","depth":2,"path":"JS/Ajax&跨域.md","ref":"JS/Ajax&跨域.md","articles":[]},{"title":"3.16 BOM","level":"1.5.25","depth":2,"path":"JS/Bom.md","ref":"JS/Bom.md","articles":[]},{"title":"3.17 ES6","level":"1.5.26","depth":2,"path":"JS/ES6.md","ref":"JS/ES6.md","articles":[]},{"title":"3.18 js实例","level":"1.5.27","depth":2,"path":"JS/js实例.md","ref":"JS/js实例.md","articles":[]}]},"previous":{"title":"2.9 滤镜","level":"1.4.9","depth":2,"path":"css/9.滤镜.md","ref":"css/9.滤镜.md","articles":[]},"dir":"ltr"},"config":{"plugins":["toggle-chapters","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"toggle-chapters":{},"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"gitbook电子书","gitbook":"*","description":"记录前端相关的知识点以及一些示例的demo"},"file":{"path":"css/10.布局.md","mtime":"2019-09-02T09:23:21.163Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-06T08:37:43.293Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

